/**
 * @Author Fish Paradise
 * @Description initialization on demand holder
 * @Date 2019/1/18  16:35
 **/
public class IoDHSingleton {
    private IoDHSingleton(){}

    private static class IoDHSingletonHandle {
        private final static IoDHSingleton INSTANCE = new IoDHSingleton();
    }

    public static IoDHSingleton getInstance(){
        return IoDHSingletonHandle.INSTANCE;
    }

    public void speak(){
        System.out.println("这是是用内部类");
    }
}
